import java.io.IOException;
import static java.lang.System.out;
import java.nio.file.*;
public class Ls {
    public static void main(String[] args) throws IOException{

        String glob = args.length == 0?"*":args[0];
        Path userPath = Paths.get(System.getProperty("user.dir"));
        try(DirectoryStream<Path> directoryStream = Files.newDirectoryStream(userPath,glob)){
            directoryStream.forEach(
                path -> out.println(path.getFileName()));

                }
    }
}

